// import something here

// "async" is optional;
// more info on params: https://quasar.dev/quasar-cli/boot-files
const storage = {
    getItem(name) {
        const data = window.localStorage.getItem(name)
        try {
            return JSON.parse(data)
        } catch {
            return data
        }
    },
    setItem(name, value) {
        if (typeof value === 'object') {
            let data = JSON.stringify(value);
            window.localStorage.setItem(name, data);
        } else {
            window.localStorage.setItem(name, value);
        }
  
    },
    removeItem(name) {
        window.localStorage.removeItem(name);
    }
  }
  export default async ({ app, router, Vue }) => {
    Vue.prototype.$storage = storage
  }
  